<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <script src="${initParam.root}/jquery-1.8.3.js"></script>
<!-- 아이디 패스워드 찾는 페이지 css -->
<style type="text/css">
h3
{
	margin-top: 50px;
	margin-left: 180px;
	margin-bottom: 50px;
}
ul
{
	list-style: none;
}
#아이디찾기
{
	margin: auto;
	margin-left: 150px;
	width: 420px;
	height: 250px;
	background: url("${initParam.root }/img/main/find/main-findidpassword-background1.gif");
	background-repeat: no-repeat;
	float: left;
}
#비밀번호찾기
{
	margin: auto;
	width: 420px;
	height: 250px;
	background: url("${initParam.root }/img/main/find/main-findidpassword-background1.gif");
	background-repeat: no-repeat;
	float: left;
}
.idtitle
{
	margin-top: 15px;
	margin-left: 25px;
}
.idinfo
{
	margin-top: 15px;
	margin-left: 30px;
}
#idnemail
{
	background: url("${initParam.root }/img/main/find/main-findidpassword-background2.gif");
	background-repeat: no-repeat;
	height: 100px;
	margin-top: 15px;
	margin-left:20px; 
}
.idname
{
	padding-top: 15px;
	margin-left: -10px;
}	
.idemail
{
	margin-top: -23px;
	margin-left: -25px;
}
#userName
{
	width: 120px;
	margin-left: 14px;
}
#userEmail
{
	width: 120px;
}
#findId
{
	margin-left: 20px;
}
.passtitle
{
	margin-top: 15px;
	margin-left: 25px;
}
.passinfo
{
	margin-top: 15px;
	margin-left: 30px;
}
.passid
{
	padding-top: 15px;
	margin-left: -10px;
}	
.passemail
{
	margin-top: -23px;
	margin-left: -20px;
}
#userId1
{
	width: 120px;
	margin-left: 14px;
}
#userEmail1
{
	width: 120px;
}
#findPass
{
	margin-left: 20px;
}
</style>

<!-- 공란체크 및 아이디 패스워드 찾는 javascript 부분 -->
<script type="text/javascript">
    $(function(){
     	$("#findId").click(function(){
    		var name =$("#userName").val();
    		var email =$("#userEmail").val();
    		if(name==""){
    			alert("이름을 입력하세요");
    			$("#userName").focus();
    			return;
    		}else if(email==""){
    			alert("이메일을 입력하세요");
    			$("#userEmail").focus();
    			return;
    		}
    		
    		$.ajax({
    			type:"POST",
    			url:"member.do?command=findId",
    			data:"m_name="+name+"&m_email="+email,
    			success:function(data){
    				if(data.fail!=null){
    					$("#idnemail").html(data.fail);
    				}else{
    				$("#idnemail").html("<center>"+data.mvo.m_id+"</center>");
    				}
    			}
    		});
    	});//click 
  	$("#findPass").click(function(){
    		var id =$("#userId1").val();
    		var email =$("#userEmail1").val();
    		if(id==""){
    			alert("아이디를 입력하세요");
    			$("#userId1").focus();
    			return;
    		}else if(email==""){
    			alert("이메일을 입력하세요");
    			$("#userEmail1").focus();
    			return;
    		}
    		$("#findPassForm").submit();
    	});//click; 
    });//load
</script>

<!-- 아이디 & 패스워드 찾는 화면페이지 -->

<h3><img src="${initParam.root }/img/main/find/main-findidpassword-title.gif" alt="제목" /></h3> 

<div id="아이디찾기">
	<img alt="title" src="${initParam.root }/img/main/find/main-findidpassword-idfind.gif" class="idtitle"><br>
	<img alt="info" src="${initParam.root }/img/main/find/main-findidpassword-info1.gif" class="idinfo">
	<div id="idnemail">
		<ul>
			<li class="idname"><img alt="이름" src="${initParam.root }/img/main/find/main-findidpassword-name.gif"> <input type="text" name="m_name" id="userName" ></li>
			<li class="idemail">
				<img src="${initParam.root }/img/main/find/main-findidpassword-email.gif"> <input type="text" name="m_email" id="userEmail" >
				<img src="${initParam.root }/img/main/find/main-findidpassword-idBtn.jpg" id="findId">
			</li>
		</ul>
	</div>
</div>

<div id="비밀번호찾기">
	<form id="findPassForm" name="findPassForm" action="${initParam.root }/member.do">
	<input type="hidden" value="findPassword" name="command">
	<img alt="title" src="${initParam.root }/img/main/find/main-findidpassword-passwordfind.gif" class="passtitle"><br>
	<img alt="info" src="${initParam.root }/img/main/find/main-findidpassword-info2.jpg" class="passinfo">
		<div id="idnemail">
			<ul>
				<li class="passid"><img alt="아이디" src="${initParam.root }/img/main/find/main-findidpassword-id.gif"> <input type="text" name="m_id1" id="userId1" ></li>
				<li class="passemail">
					<img alt="이메일" src="${initParam.root }/img/main/find/main-findidpassword-email.gif"> <input type="text" name="m_email1" id="userEmail1" >
					<img alt="전송버튼" src="${initParam.root }/img/main/find/main-findidpassword-passwordBtn.jpg" id="findPass">
				</li>
			</ul>
		</div>
	</form>
</div>

